let initState = {
  list: window.localStorage.getItem('state') ? JSON.parse(window.localStorage.getItem('state')).list : {}
};

function reducer(state = initState, actions) {
  switch (actions.type) {
    case "SET_LIST":
      state.list = actions.data;
      break;
    default:

  }

  window.localStorage.setItem('state', JSON.stringify(state));
  return JSON.parse(JSON.stringify(state));
}

export default reducer;